<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<script>
	$(function(){
		$("#userForm select[name=role_id]").combobox({
			editable:false,
			required:true,
			valueField:'role_id',
			textField:'role_name',
			url:ctx+'/sys/paramGroup/getParam.htm?info=1Py9zkON2J'
		}).combobox("setValue","2");
		$("#userForm select[name=state]").combobox({
			editable:false,
			required:true,
			valueField:'code',
			textField:'code_desc',
			url:ctx+'/sys/paramGroup/getParam.htm?info=OS4cqbVroP&info=comm&info=state'
		}).combobox("setValue","A");
		var id="${param.id}";
		if(id.length>0){
			$("#userForm").form('load',ctx+'/sys/user/get.htm?id='+id);
			$("#userForm input[name=password]").validatebox({
				required : false
			});
		}else{
			//$("#userForm select[name=state]").combobox("setValue","A");
			//$("#userForm select[name=role_id]").combobox("setValue","2");
		}
	});
</script>
<div align="center">
	<form id="userForm" method="post">
		 <input name="user_id" type="hidden" />
		 <input name="data" type="hidden" />
			<table class="tableForm">
				<tr>     
                   <td style="width:70px;" >帐号：</td>
                    <td style="width:150px;">    
                        <input name="user_code" class="easyui-validatebox" 
                        	data-options="required:true"  validType="checkUser[ctx+'/sys/user/checkUser.htm']"   data-options="validType:'length[4,10]'"  />
                    </td>
                   <td style="width:70px;" >名字：</td>
                    <td style="width:150px;">    
                        <input name="user_name" class="easyui-validatebox" 
                        	data-options="required:true,validType:'length[2,5]'" />
                    </td>
                </tr>
               <tr>
                    <td style="width:70px;">密码：</td>
                    <td style="width:150px;" title="如果不更改密码,请留空!">    
                        <input name="password" class="easyui-validatebox" 
                        	 data-options="required:true"  type="password"  />
                    </td>
                   <td style="width:70px;">邮箱：</td>
                    <td style="width:150px;">    
                        <input name="email" class="easyui-validatebox" 
                        	data-options="required:true"  validType="email" />
                    </td>
                </tr>      
                <tr>
                    <td style="width:70px;">状态：</td>
                    <td  style="width:150px;">
                        <select id="state" name="state" style="width: 156px;" ></select>
                    </td>
                     <td style="width:70px;">角色：</td>
                    <td  style="width:150px;">
                        <select name="role_id" style="width: 156px;" ></select>
                    </td>
                </tr> 
			</table>
		</form>
</div>